package com.monitor.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.monitor.entity.ErpCustomerWarehouse;

/**
 * <p>
 * 客户仓库表 Mapper 接口
 * </p>
 *
 * @author LX
 * @since 2018-09-06
 */
public interface ErpCustomerWarehouseMapper extends BaseMapper<ErpCustomerWarehouse> {
	@Select("select cw.id from erp_customer_warehouse cw where cw.customer_id=#{custId}")
	public List<Integer> selectByCustId(@Param("custId")int custId);
	
	@Select("select cw.id from erp_customer_warehouse cw where cw.customer_id in (select c.id from erp_customer c where c.id  in (${cusIds}))")
	public List<Integer> selectBycusIds(@Param("cusIds")String cusIds);
	
	@Select("select * from erp_customer_warehouse cw where cw.customer_id=#{custId} and cw.war_name=#{warName} order by id desc limit 0,1")
	public ErpCustomerWarehouse selectByIdAndName(@Param("custId")int custId,@Param("warName")String warName);
}
